﻿<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8" /> 
<title>WebQQ_TestSounds</title> 
<script src="http://web.qstatic.com/jsapi/alloy.api.js"></script> 
<script src="http://web.qstatic.com/jsapi/alloyos.js"></script> 
<script>
// 播放音乐
function playSound(){
	alloy.sound.play("/sounds/msg.mp3", true);
}
//设为静音
function setMute(){
	alloy.sound.setMute({
		flag:true
	});
}
//判断是否为静音
function isMute(){
	alloy.sound.isMute(function(res){
		alloy.system.alert({
			msg:((res>=1)?"是":"不是")+"静音"
		},function(r){
			if(r){
				alloy.window.setCurrent();
			}
		});
	});
}
</script> 
</head> 
<body>
<button onclick="playSound();">播放音乐</button>
<button onclick="setMute();">设为静音</button>
<button onclick="isMute();">判断是否为静音</button>
</body> 
</html>